
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(signal LANGUAGES C)

include_directories(../common)

set(COMPILE_ALL OFF)

list(APPEND _sources
    ../common/error.c
    ../common/prexit.c
    ../common/lockfile.c
    ../common/setfd.c
    ../common/setfl.c
    ../common/clrfl.c
    ../common/lockreg.c
    ../common/locktest.c
    ../common/tellwait.c
    06_readn.c
    07_writen.c
)

if (COMPILE_ALL)
add_executable(nonblockw 01_nonblockw.c ${_sources})
add_executable(deadlock 02_deadlock.c ${_sources})
add_executable(mandatory 03_mandatory.c ${_sources})
add_executable(rot13a 04_rot13a.c ${_sources})
add_executable(rot13c2 05_rot13c2.c ${_sources})
else()
add_executable(mcopy2 08_mcopy2.c ${_sources})
endif()
